Trait isotope::ctx::cons::ConsCtx [−][src]
pub trait ConsCtx { fn is_pointer_cons(&self) -> bool; fn shallow_cons(&mut self, id: &TermId) -> Option<TermId>; fn try_cons(&self, id: &Term) -> Result<Option<TermId>, ()>; fn check_cons(&self, id: &Term) -> bool; fn uncons(&self, code: Code) -> Option<TermId>; fn as_dyn_cons_mut(&mut self) -> &mut dyn ConsCtx; }
Expand description
A type which may be used as a context for creating isotope
terms
Required methods
fn is_pointer_cons(&self) -> bool
[src]
fn is_pointer_cons(&self) -> bool
[src]Whether when two terms are consed by this context they are guaranteed to be pointer-equal
fn shallow_cons(&mut self, id: &TermId) -> Option<TermId>
[src]
fn shallow_cons(&mut self, id: &TermId) -> Option<TermId>
[src]Shallow-cons a term; if already consed, return TermId
.
Note that if a deep-cons property is desired, this function should only ever be called with deep-consed terms!
fn check_cons(&self, id: &Term) -> bool
[src]
fn check_cons(&self, id: &Term) -> bool
[src]Check whether this TermId
is consed
Get a term with the given code, if any has been registered into this context. May not be the only term with that code in the case of a hash collision.
fn as_dyn_cons_mut(&mut self) -> &mut dyn ConsCtx
[src]
fn as_dyn_cons_mut(&mut self) -> &mut dyn ConsCtx
[src]Convert this to a trait pointer
Note: due to trait issues, there can be no default implementation for this